package com.dzm.client;

import com.dzm.client.impl.StudentClientFallBack;
import com.dzm.factory.StudentClientFallBackFactory;
import com.dzm.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 作者：Dzm
 * 时间：2024-08-22-9:28
 * 功能：
 */

//使用服务熔断需要使用sentinel，并且配置sentinel对feign的支持
//@FeignClient(value = "student-server", fallback = StudentClientFallBack.class)
@FeignClient(value = "student-server", fallbackFactory = StudentClientFallBackFactory.class)
public interface StudentClient {

    //获取学生列表
    @GetMapping("/student/list")
    public R list();

    @GetMapping("/student/getStudentById/{id}")
    public R getById(@PathVariable("id")Integer id);
}
